Skip to content

images: check Fedora package signatures in the image build - #135

Merged
DjDeveloperr merged 1 commit into
mainfrom
fix/image-fedora-gpgcheck
Nov 3, 2026
Merged

DjDeveloperr merged 1 commit into
mainfrom
fix/image-fedora-gpgcheck

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Image builds now check the signature of every Fedora package, not only Aurora's.

Problem

The pinned KIWI description (repositories/core.xml) declares Fedora's fedora and updates repositories with a <signing> key but no package_gpgcheck. KIWI 11.1.1's dnf5 backend (add_repo(..., pkg_gpgcheck=False)) then writes gpgcheck=0 into each repository file. That overrides the gpgcheck=1 that <rpm-check-signatures> puts in [main]. PR #134 fixed this for the Aurora repository only.

Change

images/configure.py sets package_gpgcheck="true" on every upstream repository and refuses one without a <signing> key ("review the integration", like the other upstream checks). KIWI already imports <signing> keys into the image rpm database before the first package.

The key stays the description's file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-$releasever-primary. It is byte-identical to fedora-gpg-keys' copy: same sha256, fingerprint 36F612DCF27F7D1A48A835E4DBFCF71C6D9F90A6. Its path also stays put across build-host releases. Fedora 45's fedora-gpg-keys keeps its keys under /usr/share/pki/rpm-gpg and no longer has /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-44-primary. images.yml already installs distribution-gpg-keys. The image itself still imports fedora-gpg-keys' key in upstream's config.sh.

Evidence

kiwi-ng --type oem --profile Minimal --target-arch=aarch64 system prepare ran in a fedora:44 aarch64 container (kiwi 11.1.1, dnf5 5.4.6) against the live testing feed. To prove the check is enforced, one run swapped the Fedora key for Fedora 43's.

Description Fedora key Result
main Fedora 43 (wrong) succeeds. dnf5: skipped OpenPGP checks for 184 packages from repositories: fedora, updates (bootstrap), then … 626 packages … (system)
this PR Fedora 43 (wrong) stops at bootstrap: Signature verification failed, OpenPGP check for package "filesystem-3.18-52.fc44.aarch64" … from repo "fedora" has failed
this PR Fedora 44 (shipped) succeeds with no skipped checks. 866 packages, 810 signed by the Fedora 44 key; gpg-pubkeys in the image: Fedora (44) and Aurora

config.sh ran in the successful runs, so the image checks passed too. The full image build (disk, finalizer, check-basics.py) is images.yml, which I have not dispatched.

Checks job steps on Linux (fedora:44): unittest discover -s tests (249, OK), images/test_configure.py (17, OK; the new test fails on main's configure.py), compileall, bash -n, git diff --check.

No package changes, so no spec bump.

🤖 Generated with Claude Code

The pinned KIWI description declares Fedora's fedora and updates
repositories with a <signing> key but no package_gpgcheck. KIWI's
dnf5 backend (kiwi 11.1.1) then writes gpgcheck=0 into their repo
files, which overrides the gpgcheck=1 that <rpm-check-signatures>
sets in [main]. On main, a Minimal `kiwi-ng system prepare` in a
fedora:44 container with the Fedora key swapped for Fedora 43's
still succeeds, and dnf5 says so:

  Warning: skipped OpenPGP checks for 184 packages from repositories: fedora, updates
  Warning: skipped OpenPGP checks for 626 packages from repositories: fedora, updates

configure.py now sets package_gpgcheck on every upstream repository
and refuses one without a signing key. KIWI imports the <signing>
keys into the image rpm database before the first package, so dnf5
checks every Fedora package against the description's key,
/usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-44-primary.
That file has the same bytes as fedora-gpg-keys' copy (fingerprint
36F612DCF27F7D1A48A835E4DBFCF71C6D9F90A6), and its path does not move
between host releases, while Fedora 45's fedora-gpg-keys keeps its
keys under /usr/share/pki/rpm-gpg instead of /etc/pki/rpm-gpg.
images.yml already installs distribution-gpg-keys.

The same prepare with this change:

- correct key: succeeds with no skipped checks; the root holds 866
  packages, 810 of them signed by the Fedora 44 key.
- Fedora 43's key: stops at bootstrap with "Signature verification
  failed" for filesystem-3.18-52.fc44 from repo "fedora".

Assisted-by: Claude Opus 5.5
@DjDeveloperr
DjDeveloperr merged commit 0132b81 into main Nov 3, 2026
15 checks passed
@DjDeveloperr
DjDeveloperr deleted the fix/image-fedora-gpgcheck branch November 3, 2026 00:44
RyanTheTide added a commit that referenced this pull request Nov 9, 2026
…134, #133)

RC8.2 = RC8.1 + speakerguardd#134: a switch in the running boot grants at
once (aurora-speaker-upgrade's umask 077 leaked into v2's provisioning, so
/run/speakerguardd-graph was unreadable to the seat user and the speakers
stayed silent until a reboot; found by the RC8 E2E on the M1 Pro and M2),
#133 (the MacBook Neo's speaker PCM wakes on period interrupts), and voicing
parity #129/#135. aurora-speaker-upgrade rides on the same commit.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant